package lab02.test02;

public class Circular {
    private float radius;
    private float area;
    private float perimeter;
    private static final float Π = 3.1415926f;
    public Circular(){

    }

    public Circular(float radius, float area, float perimeter) {
        this.radius = radius;
    }

    public float getRadius() {
        return radius;
    }

    public void setRadius(float radius) {
        this.radius = radius;
    }
    //通过方法求圆的面积
    public void area(){
        area = Π * radius * radius;
        System.out.println("圆得面积为：" + area);
    }
    //通过方法求圆的周长
    public void perimeter(){
        perimeter = 2 * Π * radius;
        System.out.println("圆得周长为：" + perimeter);
    }
}
